import { Tprops } from "./types";
import WarpDiv from "./warp";
export default function Number (props:Tprops&{line?:number,inline?:boolean}){
    const line=props.line||1;
    const nums = +(props.data.length/line).toFixed(0);
    const data=[]
    for(let i=0;i<line;i++){
        data.push(props.data.slice(i*nums,(i+1)*nums).map(v=> <div className="xxl-flex-1 ">
            <span className="numers">{v.value}</span>
            <div className="label"><span>{v.labelName}</span></div>
         </div>))
    }
   return <div className={["xxl-flex-column xxl-flex warpDiv bf-none number-show",props.inline?'xxl-flex-1':''].join(' ')}>
        {props.title?<div className="title-show">{props.title}</div>:null}
         {data.map(v=> <div className="xxl-flex xxl-flex-1 row-show xxl-flex-center">{v}</div>)}
    </div>
}